<div id="content" class="text-box">
<?php
      $c = new Criteria();
      $c->addAscendingOrderByColumn( jwGalleryPicturePeer::ORDER );
?>
  <h1 class="left-pad-20" ><?php echo $apartman->getName(); ?></h1>      
  <div id="leiras" class="apartman-details" >
	<?php if( $apartman->getjwGallery()->getjwGalleryPictures() ): ?>
	  <img class="thumb-200" src="<?php echo url_for( 'jwGallery/getImage?id='.current( $apartman->getjwGallery()->getjwGalleryPictures( $c ) )->getId().'&thumb=300' ) ?>" />
	<?php endif ?>
	
	<div style="overflow:hidden">
	  <div class="description" >
		<h2><?php echo __('description') ?></h2>
		<p><?php echo $apartman->getShortDetails(); ?></p>
	  </div>
	</div>

	  <?php echo link_to( '<div class="golden-button" id="book">Book now</div>', 'book/step1?apartman_id='.$apartman->getId(), array( 'class' => 'book-button' ) ) ?>
	<div class="clear" ></div>
	<br/>
	
	<div class="tab" ID="tab-container">
	  <div class="tab-header-container">
		<span class="tab-header selected" id="details-header">
		  <span class="left"></span>
		  <span><h2 ><?php echo __('details') ?></h2></span>
		  <span class="right"></span>
		</span>
		<span class="tab-header" id="prices-header">
		  <span class="left" ></span>
		  <span><h2 ><?php echo __('prices') ?></h2></span>
		  <span class="right" ></span>
		</span>		
		<span class="tab-header" id="pictures-header">
		  <span class="left" ></span>
		  <span><h2 ><?php echo __('gallery') ?></h2></span>
		  <span class="right" ></span>
		</span>
		<span class="tab-header" id="map-header">
		  <span class="left" ></span>
		  <span><h2 ><?php echo __('map') ?></h2></span>
		  <span class="right" ></span>
		</span>
	  </div>
	  <div class="clear" ></div>
	  <div class="tab-body-container" >
		<div id="details-body" >
		  <div class="summary">
			<table>
			      <tbody>
				    <tr>
					  <th>Square meters:</th>
					  <td colspan="2"><?php echo $apartman->getSquareMeters() ?></td>						  
				    </tr>
				    <tr>
					  <th>Max occupancy:</th>
					  <td><?php echo $apartman->getMaxOccupancy() ?></td>
				    </tr>
				    <tr>
					  <th>Bedrooms:</th>
					  <td><?php echo $apartman->getBedrooms() ?></td>
				    </tr>
				    <tr>
					  <th>Beds:</th>
					  <td><?php echo $apartman->getBeds() ?></td>
				    <tr>
					  <th>Bathrooms:</th>
					  <td><?php echo $apartman->getBathrooms() ?></td>
				    </tr>
				
				    <tr>				      
					  <th>Address:</th>
					  <td><?php echo $apartman->getAddress() ?>
					  <br/>
					  <?php echo $apartman->getCity() ?>
					  <br/>
					  <?php echo $apartman->getZip() ?>
					  </td>					  
				    </tr>

				
				    <tr>
					  <th>Check in options:</th>
					  <td><?php echo $apartman->getCheckInOptions() ?></td>
				    </tr>
				    <tr>
					  <th>Check out options:</th>
					  <td colspan='2'><?php echo $apartman->getCheckOutOptions() ?></td>
				    </tr>
			      </tbody>
			</table>
		  </div>
		  <?php echo $apartman->getFullDescription() ?>
		  <div class="clear"></div>
		</div>
	    <div id="prices-body" class="hide" >
			<?php echo $apartman->getPriceTable() ?>
		</div>		  
		<div id="pictures-body" class="hide">
		  <?php include_component( 'jwGallery', 'getGallery', array( 'gallery_id' => $apartman->getGalleryId() ) ) ?>
		</div>
		<div id="map-body" class="hide">
		  <table>
			<tr>
			      <td class="map"><?php echo $apartman->getMap() ?></td>
			      <td class="location-description" ><?php echo $apartman->getLocation() ?></td>
			</tr>
		  </table>
		</div>
	  </div>
	</div>


  </div>

<center><img src="/images/motivum.gif" name="motivum" width="93" height="24" id="motivum" /></center>

</div>

<script>

  function Tab( container )
  {
	var childNodes = container.children;
	var headNodes;
	
	$( '.tab-header' ).bind( 'click', function(){
	  if( $( '.tab-header.selected' ) != $(this) )
	  {
		$( '#'+$( '.tab-header.selected' ).attr('id').replace( 'header', 'body') ).hide();
		$( '.tab-header.selected' ).removeClass( 'selected' );
		$(this).addClass( 'selected' );
		$( '#'+$(this).attr('id').replace( 'header', 'body') ).show();
	  }
	}).css('cursor', 'pointer' );
  };

  
  new Tab( document.getElementById( 'tab-container' ) );
</script>